import requests
from patagent.model import ApiRequest


def http_request(request: ApiRequest):
    params = None
    body = None
    if request.method.upper() == 'GET':
        params = request.parameters
    else:
        body = request.parameters
        
    return requests.request(request.method, request.url, params=params, json=body)
